<?php
/**
 *
 *
 *
 */
namespace Yz\modules\News;

class Action_SelectByTitle
    extends \Yz\modules\Generic\Action_Select
{

    /**
     *  @var string
     */
    protected $title;

    /**
     *  @param int id > 0
     *  @return this
     */
    public function setTitle( $title )
    {
        debug();
        $this->title = \Yz_String::testNotEmpty($title);
        return $this;
    }

    /**
     *  Modified SELECT statement creator
     *
     */
    protected function buildSelect()
    {
        $sql = parent::buildSelect();
        $sql
            ->where($this->primaryTable . ".title=:_title")
            ->bind("_title", $this->title);
        return $sql;
    }


}
